{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "219d9dd7",
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Timeline\n",
    "from pyecharts.commons.utils import JsCode\n",
    "from pyecharts.faker import Faker\n",
    "import pandas as pd\n",
    "import datetime\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "892ee0ea",
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "Excel file format cannot be determined, you must specify an engine manually.",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_24288/1526410258.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdf\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread_excel\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'D:/data/TFL2_TAQ_TF1403_201401.csv'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mnames\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'date'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'time'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'symbol'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'high'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'low'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'avg'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'close'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mindex_col\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;34m'date'\u001b[0m \u001b[1;33m,\u001b[0m\u001b[0mdate_parser\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'date'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\vnstudio\\lib\\site-packages\\pandas\\util\\_decorators.py\u001b[0m in \u001b[0;36mwrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m    309\u001b[0m                     \u001b[0mstacklevel\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mstacklevel\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    310\u001b[0m                 )\n\u001b[1;32m--> 311\u001b[1;33m             \u001b[1;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    312\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    313\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0mwrapper\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32mc:\\vnstudio\\lib\\site-packages\\pandas\\io\\excel\\_base.py\u001b[0m in \u001b[0;36mread_excel\u001b[1;34m(io, sheet_name, header, names, index_col, usecols, squeeze, dtype, engine, converters, true_values, false_values, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, parse_dates, date_parser, thousands, comment, skipfooter, convert_float, mangle_dupe_cols, storage_options)\u001b[0m\n\u001b[0;32m    362\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mio\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mExcelFile\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    363\u001b[0m         \u001b[0mshould_close\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 364\u001b[1;33m         \u001b[0mio\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mExcelFile\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mio\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstorage_options\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mstorage_options\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mengine\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mengine\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    365\u001b[0m     \u001b[1;32melif\u001b[0m \u001b[0mengine\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mengine\u001b[0m \u001b[1;33m!=\u001b[0m \u001b[0mio\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mengine\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    366\u001b[0m         raise ValueError(\n",
      "\u001b[1;32mc:\\vnstudio\\lib\\site-packages\\pandas\\io\\excel\\_base.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, path_or_buffer, engine, storage_options)\u001b[0m\n\u001b[0;32m   1194\u001b[0m                 \u001b[1;32mif\u001b[0m \u001b[0mext\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1195\u001b[0m                     raise ValueError(\n\u001b[1;32m-> 1196\u001b[1;33m                         \u001b[1;34m\"Excel file format cannot be determined, you must specify \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   1197\u001b[0m                         \u001b[1;34m\"an engine manually.\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1198\u001b[0m                     )\n",
      "\u001b[1;31mValueError\u001b[0m: Excel file format cannot be determined, you must specify an engine manually."
     ]
    }
   ],
   "source": [
    "\n",
    "df = pd.read_excel('D:/data/TFL2_TAQ_TF1403_201401.csv',names=['date','time','symbol','high','low','avg','close'],index_col = 'date' ,date_parser='date')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "b9e14764",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "df = pd.read_csv('D:/data/TFL2_TAQ_TF1403_201401.csv', header=None)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "2e0c431b",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "df2 = pd.read_csv('D:/data/TFL2_TAQ_TF1403_201401.csv', usecols=lambda x: x.upper() in ['A', 'C'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "d918b215",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>52</th>\n",
       "      <th>53</th>\n",
       "      <th>54</th>\n",
       "      <th>55</th>\n",
       "      <th>56</th>\n",
       "      <th>57</th>\n",
       "      <th>58</th>\n",
       "      <th>59</th>\n",
       "      <th>60</th>\n",
       "      <th>61</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20140102</td>\n",
       "      <td>2014-01-02 07:05:44.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>0.000</td>\n",
       "      <td>91.802</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.000</td>\n",
       "      <td>0.000</td>\n",
       "      <td>91.804</td>\n",
       "      <td>0.000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20140102</td>\n",
       "      <td>2014-01-02 09:14:00.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.796</td>\n",
       "      <td>0.000</td>\n",
       "      <td>91.804</td>\n",
       "      <td>0.000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20140102</td>\n",
       "      <td>2014-01-02 09:15:00.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.796</td>\n",
       "      <td>0.000</td>\n",
       "      <td>91.804</td>\n",
       "      <td>0.000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20140102</td>\n",
       "      <td>2014-01-02 09:15:01.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.756</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.756</td>\n",
       "      <td>0.000</td>\n",
       "      <td>91.804</td>\n",
       "      <td>0.000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20140102</td>\n",
       "      <td>2014-01-02 09:15:01.500</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.760</td>\n",
       "      <td>91.796</td>\n",
       "      <td>91.756</td>\n",
       "      <td>0.000</td>\n",
       "      <td>91.804</td>\n",
       "      <td>0.000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136956</th>\n",
       "      <td>20140130</td>\n",
       "      <td>2014-01-30 15:14:53.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.254</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.200</td>\n",
       "      <td>0.000</td>\n",
       "      <td>92.422</td>\n",
       "      <td>0.000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136957</th>\n",
       "      <td>20140130</td>\n",
       "      <td>2014-01-30 15:14:57.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.254</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.200</td>\n",
       "      <td>0.000</td>\n",
       "      <td>92.422</td>\n",
       "      <td>0.000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136958</th>\n",
       "      <td>20140130</td>\n",
       "      <td>2014-01-30 15:15:00.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.254</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.200</td>\n",
       "      <td>0.000</td>\n",
       "      <td>92.422</td>\n",
       "      <td>0.000</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136959</th>\n",
       "      <td>20140130</td>\n",
       "      <td>2014-01-30 15:26:54.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.254</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.200</td>\n",
       "      <td>92.248</td>\n",
       "      <td>92.422</td>\n",
       "      <td>92.254</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>136960</th>\n",
       "      <td>20140130</td>\n",
       "      <td>2014-01-30 15:28:29.000</td>\n",
       "      <td>TF1403</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.254</td>\n",
       "      <td>92.402</td>\n",
       "      <td>92.200</td>\n",
       "      <td>92.248</td>\n",
       "      <td>92.422</td>\n",
       "      <td>92.254</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>208000000002</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>136961 rows × 62 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              0                        1       2       3       4       5   \\\n",
       "0       20140102  2014-01-02 07:05:44.000  TF1403   0.000  91.802   0.000   \n",
       "1       20140102  2014-01-02 09:14:00.000  TF1403  91.796  91.796  91.796   \n",
       "2       20140102  2014-01-02 09:15:00.000  TF1403  91.796  91.796  91.796   \n",
       "3       20140102  2014-01-02 09:15:01.000  TF1403  91.796  91.756  91.796   \n",
       "4       20140102  2014-01-02 09:15:01.500  TF1403  91.796  91.760  91.796   \n",
       "...          ...                      ...     ...     ...     ...     ...   \n",
       "136956  20140130  2014-01-30 15:14:53.000  TF1403  92.402  92.254  92.402   \n",
       "136957  20140130  2014-01-30 15:14:57.000  TF1403  92.402  92.254  92.402   \n",
       "136958  20140130  2014-01-30 15:15:00.000  TF1403  92.402  92.254  92.402   \n",
       "136959  20140130  2014-01-30 15:26:54.000  TF1403  92.402  92.254  92.402   \n",
       "136960  20140130  2014-01-30 15:28:29.000  TF1403  92.402  92.254  92.402   \n",
       "\n",
       "            6       7       8       9   ...  52            53  54  55  56  57  \\\n",
       "0        0.000   0.000  91.804   0.000  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "1       91.796   0.000  91.804   0.000  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "2       91.796   0.000  91.804   0.000  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "3       91.756   0.000  91.804   0.000  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "4       91.756   0.000  91.804   0.000  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "...        ...     ...     ...     ...  ...  ..           ...  ..  ..  ..  ..   \n",
       "136956  92.200   0.000  92.422   0.000  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "136957  92.200   0.000  92.422   0.000  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "136958  92.200   0.000  92.422   0.000  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "136959  92.200  92.248  92.422  92.254  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "136960  92.200  92.248  92.422  92.254  ... NaN  208000000002 NaN NaN NaN NaN   \n",
       "\n",
       "        58  59  60  61  \n",
       "0      NaN NaN NaN NaN  \n",
       "1      NaN NaN NaN NaN  \n",
       "2      NaN NaN NaN NaN  \n",
       "3      NaN NaN NaN NaN  \n",
       "4      NaN NaN NaN NaN  \n",
       "...     ..  ..  ..  ..  \n",
       "136956 NaN NaN NaN NaN  \n",
       "136957 NaN NaN NaN NaN  \n",
       "136958 NaN NaN NaN NaN  \n",
       "136959 NaN NaN NaN NaN  \n",
       "136960 NaN NaN NaN NaN  \n",
       "\n",
       "[136961 rows x 62 columns]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "8d137607",
   "metadata": {},
   "outputs": [],
   "source": [
    "import tkinter as tk\n",
    "from tkinter import ttk\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import talib as ta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "4a44366c",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "series= np.random.choice([1, -1], size=200)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "6fe3031e",
   "metadata": {},
   "outputs": [],
   "source": [
    "close=np.cumsum(series).astype(float)#重叠指标"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "73791c51",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([        nan,         nan,         nan,         nan,  1.69666295,\n",
       "         1.26491106,  1.29666295,  0.5797959 ,  1.29666295,  1.26491106,\n",
       "         1.29666295,  1.63960781,  1.82842712,  0.43960781, -0.70333705,\n",
       "        -1.30333705, -1.73508894, -1.30333705, -1.73508894, -1.70333705,\n",
       "        -1.36039219, -1.56039219, -2.30333705, -1.56039219, -0.17157288,\n",
       "         0.82842712,  1.82842712,  1.63960781,  1.69666295,  2.29666295,\n",
       "         3.43960781,  3.63960781,  3.29666295,  3.26491106,  3.69666295,\n",
       "         3.26491106,  3.69666295,  3.3797959 ,  3.5797959 ,  3.3797959 ,\n",
       "         3.69666295,  3.63960781,  3.82842712,  2.82842712,  1.82842712,\n",
       "         0.82842712, -0.56039219, -1.30333705, -0.56039219,  0.82842712,\n",
       "         0.63960781,  0.69666295,  0.3797959 ,  0.69666295,  0.26491106,\n",
       "         0.69666295,  1.43960781,  2.82842712,  2.63960781,  2.29666295,\n",
       "         2.26491106,  2.69666295,  3.43960781,  3.63960781,  3.29666295,\n",
       "         3.63960781,  3.82842712,  2.82842712,  1.82842712,  0.43960781,\n",
       "        -0.30333705,  0.43960781,  1.82842712,  2.82842712,  3.82842712,\n",
       "         3.63960781,  3.69666295,  4.29666295,  4.26491106,  4.69666295,\n",
       "         5.29666295,  5.26491106,  5.69666295,  5.3797959 ,  5.69666295,\n",
       "         5.26491106,  5.29666295,  4.69666295,  4.63960781,  4.82842712,\n",
       "         3.82842712,  2.43960781,  1.29666295,  0.5797959 ,  1.29666295,\n",
       "         1.26491106,  1.69666295,  1.3797959 ,  1.5797959 ,  1.3797959 ,\n",
       "         1.69666295,  1.63960781,  1.82842712,  0.43960781, -0.30333705,\n",
       "         0.43960781,  0.63960781,  0.29666295,  0.63960781,  0.43960781,\n",
       "        -0.70333705, -1.30333705, -1.36039219, -1.17157288, -2.56039219,\n",
       "        -3.30333705, -3.73508894, -3.30333705, -2.70333705, -2.73508894,\n",
       "        -2.30333705, -2.6202041 , -2.4202041 , -2.6202041 , -2.4202041 ,\n",
       "        -1.70333705, -0.56039219, -0.36039219, -0.30333705, -0.6202041 ,\n",
       "        -0.4202041 , -0.6202041 , -0.30333705, -0.73508894, -0.70333705,\n",
       "        -1.4202041 , -1.6202041 , -1.30333705, -1.73508894, -1.70333705,\n",
       "        -2.30333705, -2.36039219, -2.17157288, -3.17157288, -4.17157288,\n",
       "        -5.17157288, -6.17157288, -7.56039219, -8.30333705, -7.56039219,\n",
       "        -6.17157288, -5.17157288, -4.17157288, -3.17157288, -3.36039219,\n",
       "        -3.30333705, -3.6202041 , -3.30333705, -3.36039219, -3.17157288,\n",
       "        -4.56039219, -5.30333705, -5.73508894, -5.70333705, -5.73508894,\n",
       "        -5.70333705, -6.4202041 , -5.70333705, -4.56039219, -3.17157288,\n",
       "        -2.17157288, -2.36039219, -2.70333705, -2.36039219, -2.17157288,\n",
       "        -3.56039219, -4.30333705, -4.73508894, -4.70333705, -4.36039219,\n",
       "        -4.17157288, -5.17157288, -6.17157288, -7.56039219, -8.70333705,\n",
       "        -9.4202041 , -9.6202041 , -9.4202041 , -8.70333705, -7.56039219,\n",
       "        -6.17157288, -6.36039219, -6.70333705, -6.73508894, -6.30333705,\n",
       "        -6.73508894, -6.70333705, -6.36039219, -6.17157288, -7.17157288]),\n",
       " array([  nan,   nan,   nan,   nan,   0.2,   0. ,  -0.2,  -0.4,  -0.2,\n",
       "          0. ,  -0.2,  -0.4,  -1. ,  -1.6,  -2.2,  -2.8,  -3. ,  -2.8,\n",
       "         -3. ,  -3.2,  -3.4,  -3.6,  -3.8,  -3.6,  -3. ,  -2. ,  -1. ,\n",
       "         -0.4,   0.2,   0.8,   1.4,   1.6,   1.8,   2. ,   2.2,   2. ,\n",
       "          2.2,   2.4,   2.6,   2.4,   2.2,   1.6,   1. ,   0. ,  -1. ,\n",
       "         -2. ,  -2.6,  -2.8,  -2.6,  -2. ,  -1.4,  -0.8,  -0.6,  -0.8,\n",
       "         -1. ,  -0.8,  -0.6,   0. ,   0.6,   0.8,   1. ,   1.2,   1.4,\n",
       "          1.6,   1.8,   1.6,   1. ,   0. ,  -1. ,  -1.6,  -1.8,  -1.6,\n",
       "         -1. ,   0. ,   1. ,   1.6,   2.2,   2.8,   3. ,   3.2,   3.8,\n",
       "          4. ,   4.2,   4.4,   4.2,   4. ,   3.8,   3.2,   2.6,   2. ,\n",
       "          1. ,   0.4,  -0.2,  -0.4,  -0.2,   0. ,   0.2,   0.4,   0.6,\n",
       "          0.4,   0.2,  -0.4,  -1. ,  -1.6,  -1.8,  -1.6,  -1.4,  -1.2,\n",
       "         -1.4,  -1.6,  -2.2,  -2.8,  -3.4,  -4. ,  -4.6,  -4.8,  -5. ,\n",
       "         -4.8,  -4.2,  -4. ,  -3.8,  -3.6,  -3.4,  -3.6,  -3.4,  -3.2,\n",
       "         -2.6,  -2.4,  -1.8,  -1.6,  -1.4,  -1.6,  -1.8,  -2. ,  -2.2,\n",
       "         -2.4,  -2.6,  -2.8,  -3. ,  -3.2,  -3.8,  -4.4,  -5. ,  -6. ,\n",
       "         -7. ,  -8. ,  -9. ,  -9.6,  -9.8,  -9.6,  -9. ,  -8. ,  -7. ,\n",
       "         -6. ,  -5.4,  -4.8,  -4.6,  -4.8,  -5.4,  -6. ,  -6.6,  -6.8,\n",
       "         -7. ,  -7.2,  -7. ,  -7.2,  -7.4,  -7.2,  -6.6,  -6. ,  -5. ,\n",
       "         -4.4,  -4.2,  -4.4,  -5. ,  -5.6,  -5.8,  -6. ,  -6.2,  -6.4,\n",
       "         -7. ,  -8. ,  -9. ,  -9.6, -10.2, -10.4, -10.6, -10.4, -10.2,\n",
       "         -9.6,  -9. ,  -8.4,  -8.2,  -8. ,  -7.8,  -8. ,  -8.2,  -8.4,\n",
       "         -9. , -10. ]),\n",
       " array([         nan,          nan,          nan,          nan,\n",
       "         -1.29666295,  -1.26491106,  -1.69666295,  -1.3797959 ,\n",
       "         -1.69666295,  -1.26491106,  -1.69666295,  -2.43960781,\n",
       "         -3.82842712,  -3.63960781,  -3.69666295,  -4.29666295,\n",
       "         -4.26491106,  -4.29666295,  -4.26491106,  -4.69666295,\n",
       "         -5.43960781,  -5.63960781,  -5.29666295,  -5.63960781,\n",
       "         -5.82842712,  -4.82842712,  -3.82842712,  -2.43960781,\n",
       "         -1.29666295,  -0.69666295,  -0.63960781,  -0.43960781,\n",
       "          0.30333705,   0.73508894,   0.70333705,   0.73508894,\n",
       "          0.70333705,   1.4202041 ,   1.6202041 ,   1.4202041 ,\n",
       "          0.70333705,  -0.43960781,  -1.82842712,  -2.82842712,\n",
       "         -3.82842712,  -4.82842712,  -4.63960781,  -4.29666295,\n",
       "         -4.63960781,  -4.82842712,  -3.43960781,  -2.29666295,\n",
       "         -1.5797959 ,  -2.29666295,  -2.26491106,  -2.29666295,\n",
       "         -2.63960781,  -2.82842712,  -1.43960781,  -0.69666295,\n",
       "         -0.26491106,  -0.29666295,  -0.63960781,  -0.43960781,\n",
       "          0.30333705,  -0.43960781,  -1.82842712,  -2.82842712,\n",
       "         -3.82842712,  -3.63960781,  -3.29666295,  -3.63960781,\n",
       "         -3.82842712,  -2.82842712,  -1.82842712,  -0.43960781,\n",
       "          0.70333705,   1.30333705,   1.73508894,   1.70333705,\n",
       "          2.30333705,   2.73508894,   2.70333705,   3.4202041 ,\n",
       "          2.70333705,   2.73508894,   2.30333705,   1.70333705,\n",
       "          0.56039219,  -0.82842712,  -1.82842712,  -1.63960781,\n",
       "         -1.69666295,  -1.3797959 ,  -1.69666295,  -1.26491106,\n",
       "         -1.29666295,  -0.5797959 ,  -0.3797959 ,  -0.5797959 ,\n",
       "         -1.29666295,  -2.43960781,  -3.82842712,  -3.63960781,\n",
       "         -3.29666295,  -3.63960781,  -3.43960781,  -2.69666295,\n",
       "         -3.43960781,  -3.63960781,  -3.69666295,  -4.29666295,\n",
       "         -5.43960781,  -6.82842712,  -6.63960781,  -6.29666295,\n",
       "         -6.26491106,  -6.29666295,  -5.69666295,  -5.26491106,\n",
       "         -5.29666295,  -4.5797959 ,  -4.3797959 ,  -4.5797959 ,\n",
       "         -4.3797959 ,  -4.69666295,  -4.63960781,  -4.43960781,\n",
       "         -3.29666295,  -2.5797959 ,  -2.3797959 ,  -2.5797959 ,\n",
       "         -3.29666295,  -3.26491106,  -3.69666295,  -3.3797959 ,\n",
       "         -3.5797959 ,  -4.29666295,  -4.26491106,  -4.69666295,\n",
       "         -5.29666295,  -6.43960781,  -7.82842712,  -8.82842712,\n",
       "         -9.82842712, -10.82842712, -11.82842712, -11.63960781,\n",
       "        -11.29666295, -11.63960781, -11.82842712, -10.82842712,\n",
       "         -9.82842712,  -8.82842712,  -7.43960781,  -6.29666295,\n",
       "         -5.5797959 ,  -6.29666295,  -7.43960781,  -8.82842712,\n",
       "         -8.63960781,  -8.29666295,  -8.26491106,  -8.69666295,\n",
       "         -8.26491106,  -8.69666295,  -8.3797959 ,  -8.69666295,\n",
       "         -8.63960781,  -8.82842712,  -7.82842712,  -6.43960781,\n",
       "         -5.69666295,  -6.43960781,  -7.82842712,  -7.63960781,\n",
       "         -7.29666295,  -7.26491106,  -7.69666295,  -8.43960781,\n",
       "         -9.82842712, -10.82842712, -11.82842712, -11.63960781,\n",
       "        -11.69666295, -11.3797959 , -11.5797959 , -11.3797959 ,\n",
       "        -11.69666295, -11.63960781, -11.82842712, -10.43960781,\n",
       "         -9.69666295,  -9.26491106,  -9.29666295,  -9.26491106,\n",
       "         -9.69666295, -10.43960781, -11.82842712, -12.82842712]))"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ta.BBANDS(close, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "a75c435b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(<Figure size 432x288 with 2 Axes>,\n",
       " array([<AxesSubplot:>, <AxesSubplot:>], dtype=object))"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAD8CAYAAAB6paOMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAThklEQVR4nO3db4xdd33n8fenhiRq6IKpvVJkexPTuk3SbkXgyrBCWlhBEpMHNhLV1qkQDkpricVUgqpSKh5k5TyhRbtUSGmJt7WAShsH8mA11YKsiBBFWmHqa5GmxJVhcFsyLlIGHPIkbLJOvvvgnnSuJ2PP8fh67nh+75d0Nff8zvnd+c5PM/cz5889v1QVkqR2/cK0C5AkTZdBIEmNMwgkqXEGgSQ1ziCQpMYZBJLUuGWDIMnhJM8l+d4F1ifJF5LMJnk6yTvG1u1L8oPusW+ShUuSJqPPHsGXgF0XWf9BYEf32A/8BUCStwL3A+8CdgL3J9l4OcVKkiZv2SCoqieBsxfZZA/wlRo5BrwlyQ3AncBjVXW2qp4HHuPigSJJmoI3TOA1tgDPji3PdW0Xan+dJPsZ7U1w/fXXv/Pmm2+eQFmS1I4TJ078pKo2r6TvJILgslXVIeAQwGAwqOFwOOWKJOnqkuSfV9p3ElcNnQG2jS1v7dou1C5JWkMmEQQzwEe7q4feDbxQVT8GjgJ3JNnYnSS+o2uTJK0hyx4aSvIw8D5gU5I5RlcCvRGgqr4IfB24C5gFXgQ+1q07m+Q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PbivVm2bGoqm9V1Yvd4jFGn8dYj/r8XgA8wOh+Vv93NYtbZX3G4veBB6vqeYCqem6Va1wtfcaigH/TPX8z8C+rWN+qqaonGV2ZeSF7gK/UyDHgLUluWO51pxUES922YvGtJ867bQXw2m0r1ps+YzHuXkaJvx4tOxbdru62qvrfq1nYFPT5vfg14NeS/J8kx5LsWrXqVlefsfivwEeSzAFfBz65OqWtOZf6fgKskVtMqJ8kHwEGwHunXcs0JPkF4L8D90y5lLXiDYwOD72P0V7ik0n+fVX9bJpFTcndwJeq6r8l+Q+MPtf0m1X16rQLuxpMa4/gcm5bsd70ug1Hkg8AnwF2V9VLq1TbaltuLH4J+E3giST/xOgY6Mw6PWHc5/diDpipqv9Xo7v7fp9RMKw3fcbiXuCrAFX1beA6Rjeka82KbuszrSC4nNtWrDfLjkWS24CHGIXAej0ODMuMRVW9UFWbquqmqrqJ0fmS3VW14pttrWF9/kb+F6O9AZJsYnSo6PQq1rha+ozFj4D3AyS5hVEQzK9qlWvDDPDR7uqhdwMvVNWPl+s0lUNDdRm3rVhveo7F54A3AV/rzpf/qKp2T63oK6TnWDSh51gcBe5IchJ4Bfijqlp3e809x+IPgf+R5FOMThzfsx7/cUzyMKPw39SdD7kfeCNAVX2R0fmRuxjN/fIi8LFer7sOx0qSdAn8ZLEkNc4gkKTGGQSS1DiDQJIaZxBIUuMMAklqnEEgSY37//1+GB32KIOcAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.subplots(2, 1, sharex=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "6ca3445e",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "close = np.random.random(100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "9e800a3c",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'talib' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_24288/3640633223.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtalib\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mMA_Type\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mupper\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmiddle\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlower\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtalib\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mBBANDS\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mclose\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmatype\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mMA_Type\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mT3\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'talib' is not defined"
     ]
    }
   ],
   "source": [
    "from talib import MA_Type\n",
    "\n",
    "upper, middle, lower = talib.BBANDS(close, matype=MA_Type.T3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9f336869",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
